package com.macro.mall.dao;

import com.macro.mall.model.UmsMember;
import com.macro.mall.model.UmsMemberExample;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UmsMemberDao {
    long countByExample(UmsMemberExample example);

    int deleteByExample(UmsMemberExample example);

    int deleteByPrimaryKey(Long id);

    int insert(UmsMember record);

    int insertSelective(UmsMember record);

    List<UmsMember> selectByExample(UmsMemberExample example);

    UmsMember selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") UmsMember record, @Param("example") UmsMemberExample example);

    int updateByExample(@Param("record") UmsMember record, @Param("example") UmsMemberExample example);

    int updateByPrimaryKeySelective(UmsMember record);

    int updateByPrimaryKey(UmsMember record);

    /**
     * 查询会员统计信息
     * @param storeId
     * @param beginDate
     * @param endDate
     * @return
     */
    Integer selectIndexMemberStatistics(@Param("storeId") Long storeId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    /**
     * 查询会员统计折线图数据
     * @param storeIds
     * @return
     */
    List<Map<String, Object>> memberLiceChart(@Param("storeIds") List<Long> storeIds,@Param("queryWay")Integer queryWay,@Param("startDate") Date startDate,@Param("endDate") Date endDate);

    /**
     * 查询会员统计折线图数据
     * @param storeId
     * @return
     */
    List<Map<String, Object>> memberLiceChartOne(@Param("storeId") Long storeId,@Param("queryWay")Integer queryWay,@Param("startDate") Date startDate,@Param("endDate") Date endDate);
}